package cn.swu.edu.dlx;


public class Main {
    public static void main(String[] args) {
//        Main main=new Main();
        //给Student赋值
        Student yzs=new Student("yzs","22248","男",23);
        Student df=new Student("df","22251","男",20);
        Student hfr=new Student("hfr","22249","男",21);
        Student dlx=new Student("dlx","22250","男",19);

        //给course赋值
        Course Java=new Course("123321","shengwu","Java");
        Course datacontent=new Course("789897","guobin","datacontent");
        Course computer=new Course("456654","jianchen","computer");

        //提供提示，并将初始化后的信息显示出来

        System.out.println("初始学生信息：");
        yzs.showInfo();
        hfr.showInfo();
        df.showInfo();
        dlx.showInfo();

        System.out.println("初始课程信息：");
        Java.showInfo();
        datacontent.showInfo();
        computer.showInfo();

        System.out.println("\n修改学生信息\n");
        yzs.setAge(18);
        hfr.setGender("女");

        System.out.println("\n修改后的学生信息\n");
        yzs.showInfo();
        hfr.showInfo();

        System.out.println("\n修改课程信息\n");
        Java.setTeacher("wusheng");

        System.out.println("\n修改后的课程信息\n");
        Java.showInfo();


        //新增比较Student的年龄
        System.out.println("\n");
        if (yzs.getAge()> hfr.getAge()){
            System.out.println(yzs.getName()+"年龄比"+hfr.getAge()+"大"+(yzs.getAge()- hfr.getAge())+"岁");
        }else {
            System.out.println(hfr.getName()+"年龄比"+yzs.getName()+"大"+(hfr.getAge()- yzs.getAge())+"岁");
        }


    }


}
